home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gdevsvga.h < prev    next >
C/C++ Source or Header  |  1993-05-19  |  3KB  |  85 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gdevsvga.h */
  20. /* SuperVGA display definitions for Ghostscript */
  21. /* (requires gdevpcfb.h) */
  22.  
  23. /* Common procedures */
  24.  
  25.     /* See gxdevice.h for the definitions of the procedures. */
  26.  
  27. dev_proc_close_device(svga_close);
  28. dev_proc_map_rgb_color(svga_map_rgb_color);
  29. dev_proc_map_color_rgb(svga_map_color_rgb);
  30. dev_proc_fill_rectangle(svga_fill_rectangle);
  31. dev_proc_copy_mono(svga_copy_mono);
  32. dev_proc_copy_color(svga_copy_color);
  33. dev_proc_get_bits(svga_get_bits);
  34.  
  35. /* Table structure for looking up graphics modes. */
  36. typedef struct {
  37.     int width, height;        /* "key" */
  38.     int mode;            /* "value" */
  39. } mode_info;
  40.  
  41. /* The device descriptor structure */
  42. typedef struct gx_device_svga_s gx_device_svga;
  43. struct gx_device_svga_s {
  44.     gx_device_common;
  45.     int (*get_mode)(P0());
  46.     void (*set_mode)(P1(int));
  47.     void (*set_page)(P3(gx_device_svga *fbdev, int pnum, int wnum));
  48.     const mode_info _ds *mode;    /* BIOS display mode info */
  49.     uint raster;            /* frame buffer bytes per line */
  50.     int page;            /* current page */
  51.     int wnum_read, wnum_write;    /* window #s for read vs. write */
  52.     /* Following are device-specific. */
  53.     union {
  54.       struct {
  55.         void (*bios_set_page)(P2(int, int));    /* set-page function */
  56.       } vesa;
  57.       struct {
  58.         int select_reg;            /* page-select register */
  59.       } atiw;
  60.       struct {
  61.         int et_model;            /* 4 for ET4000, */
  62.                         /* 3 for ET3000 */
  63.       } tseng;
  64.     } info;
  65. };
  66.  
  67. /* The initial parameters map an appropriate fraction of */
  68. /* the screen to a full-page coordinate space. */
  69. /* This may or may not be what is desired! */
  70. #define svga_device(procs, name, get_mode, set_mode, set_page) {\
  71.     sizeof(gx_device_svga),\
  72.     &procs,\
  73.     name,\
  74.     640, 480,        /* screen size */\
  75.     480 / PAGE_HEIGHT_INCHES, 480 / PAGE_HEIGHT_INCHES, /* resolution */\
  76.     no_margins,\
  77.     dci_color(8, 31, 4),\
  78.     0,            /* not opened yet */\
  79.     get_mode, set_mode, set_page\
  80.    }
  81.  
  82. /* Utility procedures */
  83. extern int svga_find_mode(P2(gx_device *, const mode_info _ds *));
  84. extern int svga_open(P1(gx_device *));
  85.